﻿<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html;">
        <script src="../ScriptFile/jquery.js"></script>
        <script src="../ScriptFile/Common/Jquery.Common.js"></script>
        <script src="../ScriptFile/RequestParams.js"></script>
		<title>高拍仪操作</title>
        <Script language="javascript">
            var nFileCount = 0;
            var bAdjustMode = 0;
            var bCropArea = 0;
            var bSeriesCapture = 0;
            var bReadBarCode=0;
            var bSetDenoise = 0;
            var Width = 0;
            var Height = 0;
            var strFile="";
            var index = 0;
            var strCardFile;
            var cardIndex = 0;
            function Capture()
            {
	            var obj=document.getElementById("FileType") ;
	            var index=obj.selectedIndex;
	            strFile = "d:\\test\\Img" + nFileCount;
	            if(index == 0)
	            {
		            strFile += ".bmp";
	            }
	            if(index == 1)
	            {
		            strFile += ".jpg";
	            }
	            if(index == 2)
	            {
		            strFile += ".tif";
	            }
	            if(index == 3)
	            {
		            strFile += ".png";
	            }
	            CmCaptureOcx.CaptureImage(strFile);
	            nFileCount++;

	            $("#spanMsg").html("拍照成功");
            }

            function UpdataFile()
            {
                var strRoot = Common.GetRootPath();
                var striid = request("iid");
                var strUserId = request("UserId");
                var strStep = request("step");
                var filename = strFile.replace("d:\\test\\", "");
                var Url = strRoot+"/Office/GpyProcess.ashx?IID="+striid+"&UserId="+strUserId+"&step="+strStep+"&filename="+filename;
                CmCaptureOcx.UpdataFile(Url, strFile, 0);

                $("#spanMsg").html("上传成功第"+nFileCount+"个图片："+filename);
            }


            function AddDevice() {
                var i = 0;
                var total = CmCaptureOcx.GetDevCount();
                for (i = 0 ; i < total ; i++) {
                    var DevEle = CmCaptureOcx.GetDevFriendName(i);
                    Reso.DeviceName.options[i].text = DevEle;
                }
            }

            function StartVideo() {
                CmCaptureOcx.Initial();
                CmCaptureOcx.StartRun(index);
                //AddResolution2Comb(Reso);
                //SetResolution();
                //SetFileType();
            }

            function ViewFiles()
            {
                window.open("GpyUploadFilesBroswe.aspx");
            }
        </script>

        <SCRIPT type="text/javascript" for="CmCaptureOcx" event="GetImageFileName(fileName);">
	        CmCaptureOcx.AddPDFImageFile(fileName);
        </SCRIPT>

        <SCRIPT type="text/javascript"  for="CmCaptureOcx"  event="GetRButtonDownPoint(x,y);"> 
	        alert(x);	
        </SCRIPT>
</head>

	<body onload ="CmCaptureOcx.Initial();AddDevice();">
	<div style="text-align:center">
		<p>
			<OBJECT id="CmCaptureOcx" style="MARGIN-LEFT:5px; WIDTH: 52.4%; HEIGHT:80%" 
			classid="clsid:3CA842C5-9B56-4329-A7CA-35CA77C7128D" > 		
			</OBJECT>	
		</p>
        <span id="spanMsg" style=" color:red"></span>
	</div>
        <div style="text-align:center">
            <input type="button" value=" 开始视频 " onclick="StartVideo();" name="start">
            <input type="button" value=" 停止视频 " onclick="CmCaptureOcx.Destory();" name="Destory">
            <input type="button" value=" 拍    照 " onclick="Capture();" name="Capture">
            <br>

            <form name="Reso">
                设 备 名 称:
                <select name="DeviceName" id="DeviceName" onchange="ChangeDevice()">
                    <option value="0"></option>
                    <option value="1"></option>
                    <option value="2"></option>
                    <option value="3"></option>
                    <option value="4"></option>
                </select>
                分  辨  率 ：
                <select name="Resolution" id="Resolution" onchange="SetResolution()">
                    <option value="0">开启视频后获取分辨率</option>
                    <option value="1"></option>
                    <option value="2"></option>
                    <option value="3"></option>
                    <option value="4"></option>
                    <option value="5"></option>
                    <option value="6"></option>
                    <option value="7"></option>
                    <option value="8"></option>
                    <option value="9"></option>
                </select>

                图 片 格 式:
                <select name="FileType" id="FileType" onchange="SetFileType()">
                    <option value="0">bmp</option>
                    <option value="1">jpg</option>
                    <option value="2">tif</option>
                    <option value="3">png</option>
                </select>
                颜 色 格 式:
                <select name="ColourMode" id="ColourMode" onchange="SetImageColorMode()">
                    <option value="0">彩色</option>
                    <option value="1">灰度</option>
                    <option value="2">黑白</option>
                    <option value="3">印章</option>
                    <option value="4">签名</option>
                </select>
            </form>
            <input type="button" value=" 文件上传 " onclick="UpdataFile();" name="Updata" id="Updata" />
            <input type="button" value=" 查看上传文件 " onclick="ViewFiles();" name="btnViewFiles" id="btnViewFiles" />
     </div>
</body>
</html>